package org.light.framework.util;

import java.util.Collection;
import java.util.Map;

import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;


/**
 * 集合工具类
 * @author de.cel
 *
 */
public class CollectionUtil {

	/**
	 * 判断集合是否不为空
	 * @param list
	 * @return
	 */
	public static boolean isNotEmpty(Collection<?> list) {
		return CollectionUtils.isNotEmpty(list);
		//return list != null && !list.isEmpty();
	}
	
	
	/**
	 * 判断集合是否为空
	 * @param list
	 * @return
	 */
	public static boolean isEmpty(Collection<?> list) {
		return CollectionUtils.isEmpty(list);
		//return !isNotEmpty(list);
	}
	
	/**
	 * 判断Map是否不为空
	 * @param map
	 * @return
	 */
	public static boolean isNotEmpty(Map<?,?> map){
		return MapUtils.isNotEmpty(map);
	}
	
	/**
	 * 判断Map是否为空
	 * @param map
	 * @return
	 */
	public static boolean isEmpty(Map<?,?> map){
		return MapUtils.isEmpty(map);
	}
}
